package com.hdax.easybay.controller;


import com.hdax.easybuy.api.UserServiceClient;
import com.hdax.easybuy.entity.User;
import com.hdax.easybuy.entity.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserManagerController {
    @Autowired
    private UserServiceClient userServiceClient;

    @RequestMapping("/managerUser/getAll")
    public List<User> getAll() {
        return userServiceClient.queryAll();
    }
    @RequestMapping("/managerUser/getUserByuNameAndPwd/{userName}/{password}")
    public User getUserByuNameAndPwd(@PathVariable("userName") String userName,
                                     @PathVariable("password") String password){
        return userServiceClient.getUserByuNameAndPwd(userName,password);
    }

}
